package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.MallOrderIncome;
import com.sc.nft.entity.vo.MapAccumulationDetailsVO;
import com.sc.nft.entity.vo.minimall.WxMiniMallDistributionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * (sc_mall_order_income)数据Mapper
 *
 * @author Sun
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2023-05-09 14:55:38
 */
@Mapper
public interface MallOrderIncomeMapper extends BaseMapper<MallOrderIncome> {

    /**
     * 查询用户待结算收益
     *
     * @param userId
     * @return
     */
    BigDecimal getSumWaitingIncomeByUserId(@Param("userId") Long userId);

    /**
     * 地图收益
     *
     * @param userId
     * @return
     */
    BigDecimal mapAccumulation(@Param("userId") Long userId);

    /**
     * 地图收益详情
     *
     * @param page
     * @param userId
     * @return
     */
    IPage<MapAccumulationDetailsVO> mapAccumulationDetails(Page page, @Param("userId") Long userId);

    /**
     * 获取待结算收益表
     *
     * @return
     */
    List<MallOrderIncome> getSettlementIncomeList();

    IPage<WxMiniMallDistributionVO> miniMallDistributionUserPage(@Param("userTel") String userTel, Page page);

    BigDecimal getToBeSettledWxMiniUserCommission(@Param("wxMiniUserId") Long wxMiniUserId);
}
